<?php 
namespace szxh\logic;

class Kefuguanli extends Common {

    /**
     * 活动列表页
     */
    public function tableList($page) {
        // $table = new KefuguanliTable();
        $table = model('Kefuguanli');

        $sql1 = $table->getList($_GET['page']);
        $html = $table->pageHtml();
        if($sql1 === false) {
            return $this->setInfo($table->getCode(), $table->getMessage());
        }
        return [
            'sql1' => $sql1,
            'html' => $html
        ];
    }

    public function updateData($uid) {

        if(empty($uid)) {
            return $this->setInfo(100, '数据不存在');
        }

        // $table = new KefuguanliTable();
        $table = model('Kefuguanli');
        $sql2 = $table->findRow($uid);

        if($sql2 === false) {
            return $this->setInfo($table->getCode(), $table->getMessage());
        }

        if(empty($sql2)) {
            return $this->setInfo(101, '数据不能为空');
        }

        return $sql2;
    }

}